<?php
class Web_Form_Votar 
	extends Zend_Form
{
	public function init()
	{				
	
		$this->setMethod('post');
		$this->setName('votarForm');
		
		$values = range(1,10);
		
		$entrega = new Zend_Form_Element_Select('entrega');
		$entrega->addMultiOptions( array_combine( $values, $values) );
		$entrega->setLabel('deliveryService');
		$entrega->setRequired(true);
				
		$this->addElement($entrega);
		
		
		$calidad = new Zend_Form_Element_Select('calidad');
		$calidad->addMultiOptions( array_combine( $values, $values) );
		$calidad->setLabel('foodQuality');
		$calidad->setRequired(true);
				
		$this->addElement($calidad);
		
		$precio = new Zend_Form_Element_Select('precio');
		$precio->addMultiOptions( array_combine( $values, $values) );
		$precio->setLabel('price');
		$precio->setRequired(true);
				
		$this->addElement($precio);
		
		$comentario = new Zend_Form_Element_Textarea('comentario');
		$comentario->setLabel('coment');
		$comentario->setRequired(false);
		$comentario->addValidator(new Zend_Validate_StringLength(0, 250));
		
		$this->addElement( $comentario );
	    
		
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('qualify');
		$this->addElement($submit);
	
	}
	
	public function loadDefaultDecorators()	{
		
		$elements = $this->getElements();
		unset($elements['submit']);
		
		$this->addDecorator('FormElements')
			->addDecorator('HtmlTag', 	array('tag' => 'div', 'class' => 'zend_form'))
			->addDecorator('Form')
			->setElementDecorators(array(
				array('ViewHelper'),
				array('Errors',			array('placement' => 'APPEND')),
				array('Description', 	array('tag' => 'em', 'class' => 'element-description', 'placement' => 'APPEND')),
				array('Label', 			array('separator' => ' ', 'placement' => 'PREPEND')),
				array('HtmlTag', 		array('tag' => 'div', 'class' => 'element')),
				),
				array_keys($elements)
			);	

		$this->setElementDecorators(array(
				array('ViewHelper'),				
				array('HtmlTag', 		array('tag' => 'div', 'class' => 'submit-group')),
				),
				array('submit')
			);
	
	}



}